package core;

import java.util.ArrayList;

//import com.sun.org.apache.xpath.internal.functions.Function;
import functions.Function;
public abstract class Method {

	public static final int MAX_ITERATION = 50;
	public static final double EPSILON = 0.00001; 
	
	protected int numOfIteration;
	protected double precision;
	protected Function function;
	protected double finalX;
	
	public Method(int numOfIteration, double precision) {
		super();
		this.numOfIteration = numOfIteration<1?MAX_ITERATION:numOfIteration;
		this.precision = precision<0?EPSILON:precision;
	}
	
	/**
	 * this method will run the method and return (x,f(x))[]
	 * @param f
	 * @throws Exception 
	 */
	public abstract ArrayList<Point> run(Function f) throws Exception; 
	// the return value isn't void it's x,f(x) for all points.........LATER 
	public abstract double getErrorBound();
}
